<script type="text/javascript">
jQuery(document).ready(function(jQuery) {
	// Force-check at least one checkbox
	jQuery('.js_required').click(function(){
		if(!jQuery('form input[type=checkbox].js_required:checked').length) {
			jQuery(this).attr('checked', true);

		}
	})
	
	jQuery('#new_list_container').hide();

    jQuery('#new_list_trigger').click(function() { 

		jQuery('#new_list_container').slideDown();
		
		jQuery('#add_new_checkbox').attr('checked', true);
		
		jQuery('#add_new_inputbox').focus();
		
		return false;

   });
   
/*   
	<? if( !is_array($wishlists) || (empty($wishlists))) { ?>
		jQuery('#new_list_trigger').click();
		jQuery('#add_new_inputbox').val('<?=DEFAULT_WISHLIST_TITLE?>');
	<? } ?>
*/
	
});	

</script>


<h1>Move product to another list</h1>


<div class="preview">
    <div class="contain">
        <img height="66" border="0" width="106" alt="" src="<?=base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER.thumbnail($item["Main_Image"])?>"/>
        <p>
          <strong>
				<?=$item["Name_Products"]?>
          </strong>
        </p>
        
        <p>
          <?=$item["Introduction_Products"]?>
        </p>

	</div>
</div>


<form action="<?=site_url('wishlist/move')?>" method="post">

<? if (count($wishlists)<2) { ?>

        <p>Enter a name for yor new list</p>
        <input id="add_new_checkbox" type="checkbox" name="add_new" style="display:none" checked="checked" /> 
        <input id="add_new_inputbox" type="text" maxlength="36" name="wishlist_name" maxlength="128" style="width: 140px;" class="inputbox" />

<? } else { ?>

        <p>Select a list to move this product to:</p>
            
        
    <? foreach( $wishlists as $list) { ?>
    
        <label>
        <input class="js_required" type="checkbox" name="lists[]" value="<?=$list["params"]?>" <? if($list["params"]==$original_wishlist_id) echo "checked" ?> /> <?=$list["name"]?> (<?=count($list["items"])?> product<? if (count($list["items"])!=1) { ?>s<? }?>)
        </label>
    
    <? } ?>
    
    
    <!--
        <br />
        
        <label><a href="#" id="new_list_trigger">Create a new list</a></label>
        
        <div id="new_list_container">
    
            <input id="add_new_checkbox" type="checkbox" name="add_new" /> 
            <input id="add_new_inputbox" type="text" maxlength="36" name="wishlist_name" maxlength="128" style="width: 140px;" class="inputbox" />
        </div>

	-->

<? } ?>

	<br /><br /><br /><br />


	<!-- FIX ME: Move this class to the stylesheet, there should be no inline styling here -->
	<div class="bottom_buttons" style="position:absolute;bottom:30px">
    
        <input type="hidden" name="original_wishlist_id" value="<?=$original_wishlist_id?>" />
        <input type="hidden" name="product_id" value="<?=$item["id_Products"]?>" />
        <input type="hidden" name="token" id="token" value="<?=$token?>" />    
        <input class="button" type="submit" name="submit" value="MOVE" />
        <a class="button cancel" href="#">CANCEL</a>
        
    </div>

</form>